package com.three;

import com.three.controller.LoginController;
import com.three.controller.RegisterController;
import com.three.utils.MyPageBuilder;
import javafx.application.Application;
import javafx.stage.Stage;

import java.io.IOException;

public class Main extends Application {
    @Override
    public void start(Stage stage) throws IOException {
        stage.setTitle("教务系统客户端");
        // 登录界面
        MyPageBuilder<LoginController> loginPage = new MyPageBuilder<>("login.fxml");
        // 注册界面
        MyPageBuilder<RegisterController> registerPage = new MyPageBuilder<>("register.fxml");

        loginPage.getController().setPossibleScene(stage, null, registerPage.getScene());
        registerPage.getController().setPossibleScene(stage, loginPage.getScene());
        stage.setScene(loginPage.getScene());
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}